var env = process.env.NODE_ENV = process.env.NODE_ENV || 'development';
var config = require('./config')(env);

var mongoose = require('mongoose');
// var connection = mongoose.connect('mongodb://eisneim:123456@troup.mongohq.com:10009/tailor',function(err){
var connection = mongoose.connect(config.db ,function(err){
	if (err){console.log(err);
	}else{console.log('MongoDB connected.');}

});

module.exports = mongoose;

// module.exports ={
// 	mongoose:mongoose,
// 	connection:connection
// }